package cn.pzaily.orange.manage.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.CorsRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @PackageName: cn.pzaily.orange.config
 * @Description:
 * @Author: Pang
 * @Date: 2021-05-10 21:48
 */
@Configuration
public class CorsConfig implements WebMvcConfigurer {

    @Override
    public void addCorsMappings(CorsRegistry registry) {
        registry.addMapping("/**")
                .allowedOrigins("*")
                .allowedMethods("*")
                .maxAge(168000)
                .allowedHeaders("*")
                .allowCredentials(true);

    }
}
